﻿using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using MachineVision.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace MachineVision.ViewModels
{
    public partial class MainViewModel : ObservableObject
    {
        /// <summary>
        /// 导航栏集合数据
        /// </summary>
        [ObservableProperty]
        public List<NavigationItem> _navigationList = new List<NavigationItem>() { };

        /// <summary>
        /// 首页按钮内容
        /// </summary>
        [ObservableProperty]
        public string _homeTitle = "WPF/HALCON 机器视觉算法平台";

      

        public MainViewModel()
        {
            InitMainViewModel();
        }

        /// <summary>
        /// 初始化
        /// </summary>
        private void InitMainViewModel()
        {
            NavigationList.Add(new NavigationItem() { Name=  "全部", Code=0, UserControlName = "AllView" });
            NavigationList.Add(new NavigationItem() { Name = "模板匹配", Code = 1, UserControlName= "TemplateMatchView" });
            NavigationList.Add(new NavigationItem() { Name = "比较测量", Code = 2, UserControlName = "ComparativeMeasurementView" });
            NavigationList.Add(new NavigationItem() { Name = "字符识别", Code = 3, UserControlName = "CharacterRecognitionView" });
            NavigationList.Add(new NavigationItem() { Name = "缺陷检测", Code = 4, UserControlName = "DefectDetectionView" });
            NavigationList.Add(new NavigationItem() { Name = "学习文档", Code = 5, UserControlName = "StudyDocumentView" });

        }

        /// <summary>
        /// 切换菜单
        /// </summary>
        [RelayCommand]
        private void ToggleRegion(int code)
        {
            if (code == 0)
            {
                return;
            }


        }



    }
}
